package com.czk.model.facade;

/**
 * 影院的外观
 * 将各个功能组合，对外暴露方法提供调用
 * 滴啊用着不需要管内部是怎么实现的
 */
public class HomeTheaterFacade {
    private TheaterLight theaterLight;
    private Popcorn popcorn;
    private Projector projector;
    private Stereo stereo;
    private Screen screen;
    private DvdPlayer dvdPlayer;
    // 构造器中初始化

    public HomeTheaterFacade() {
        this.theaterLight = TheaterLight.getInstance();
        this.popcorn = Popcorn.getInstance();
        this.projector = Projector.getInstance();
        this.stereo = Stereo.getInstance();
        this.screen = Screen.getInstance();
        this.dvdPlayer = DvdPlayer.getInstance();
    }
    public void ready(){
        // 打开屏幕
        screen.down();
        //popcorn
        popcorn.on();
        // dvd 打开
        popcorn.on();
        // 灯光打开
        theaterLight.on();
    }
    // 播放
    public void play(){
        dvdPlayer.play();
    }
    // 暂停
    public void pause(){
        dvdPlayer.pause();
    }
    // 关掉
    public void stop(){
        dvdPlayer.off();
        //
        screen.up();
        //
        stereo.down();
        //
        popcorn.off();
    }
}
